fix: correct ylabel rotation regression in bitmap rendering #387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issue #380 where ylabels were not rotating 90 degrees counter-clockwise as expected.
Root Cause
The
rotate_bitmap_90_ccwandrotate_bitmap_90_cwfunctions infortplot_bitmap.f90had their implementations backwards. When the ylabel rendering code calledrotate_bitmap_90_ccwto rotate text 90 degrees counter-clockwise, it was actually getting a clockwise rotation.Solution
Swapped the transformation logic in both rotation functions so that:
rotate_bitmap_90_ccw: Now correctly rotates counter-clockwise using transform (i,j) → (j, width-i+1)rotate_bitmap_90_cw: Now correctly rotates clockwise using transform (i,j) → (height-j+1, i)Testing
Added comprehensive tests:
test_rotation_debug.f90: Visual debugging of rotation transformationstest_ylabel_rotation_fix.f90: Basic ylabel rendering testtest_ylabel_rotation_regression.f90: Comprehensive test with rotation logic verificationAll existing ylabel tests pass after the fix.
Fixes #380